﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.FunctionAnalysis
{
	/// <summary>
	/// Define a function interface, which can provide Derivative and Integral
	/// </summary>
	/// <typeparam name="TInput">Input Type</typeparam>
	/// <typeparam name="TResult">Result Type, in many cases, it will be just the same as TResult</typeparam>
	public interface IFunction<in TInput, out TResult>
	{
		/// <summary>
		/// The function itself
		/// </summary>
		Func<TInput, TResult> Functor { get; }
		/// <summary>
		/// First order derivative
		/// </summary>
		IFunction<TInput, TResult> Derivative { get; }
		/// <summary>
		/// First order integral, with integral constant being 0
		/// </summary>
		IFunction<TInput, TResult> Integral { get; }
	}
}
